package ${rootPkg}.service.${modelName}.${entityVar};

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bitkit.basic.annotation.ServiceTag;
import cn.bitkit.component.BaseService;

import ${rootPkg}.pojo.dto.${modelName}.${entityVar}.${entityName}SelectReq;
import ${rootPkg}.pojo.dto.${modelName}.${entityVar}.${entityName}SelectResp;
import ${rootPkg}.pojo.entity.${modelName}.${entityName};
import ${rootPkg}.mapper.${modelName}.${entityName}Mapper;

@Service
@ServiceLabel("${entityVar}Select")
public class ${entityName}SelectService implements BaseService<${entityName}SelectReq, ${entityName}SelectResp> {

    @Autowired
    ${entityName}Mapper ${entityVar}Mapper;

    @Override
    public ${entityName}SelectResp execute(${entityName}SelectReq req) {
        ${entityName} entity = ${entityVar}Mapper.selectById(req.get${primaryKeyUpper}());
        if(entity == null) {
            return null;
        }
        ${entityName}SelectResp resp = new ${entityName}SelectResp();
        BeanUtils.copyProperties(entity, resp);
        return resp;
    }
}